Throttle playback progress publishers to reduce UI lag#1510
Open
matalvernaz wants to merge 1 commit intoTortugaPower:developfrom
Open
Throttle playback progress publishers to reduce UI lag#1510matalvernaz wants to merge 1 commit intoTortugaPower:developfrom
matalvernaz wants to merge 1 commit intoTortugaPower:developfrom
Conversation
The .bookPlaying and .listeningProgressChanged notifications fire every second from the AVPlayer periodic time observer, causing recalculateProgress() to update multiple @published properties on every tick. Similarly, currentProgressPublisher and immediateProgressUpdatePublisher in ItemProgressView trigger per-second redraws for every visible library row. On lower-powered devices (e.g. iPhone SE 2), this causes noticeable UI lag during playback. This adds 500ms throttling on the player progress publishers (keeping slider updates smooth) and 1s throttling on the library progress views (matching the existing folderProgressUpdated throttle). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1509
.bookPlayingand.listeningProgressChangedsubscribers inPlayerViewModel(keeps slider updates smooth while halving redraws)currentProgressPublisherandimmediateProgressUpdatePublisherinItemProgressView(matches the existingfolderProgressUpdatedthrottle)Context
The AVPlayer periodic time observer fires every 1 second. Without throttling, each tick triggers
recalculateProgress()(updating ~6@Publishedproperties) and redraws every visible library row's progress ring. On lower-powered devices like the iPhone SE 2, this causes noticeable lag during playback.Test plan
🤖 Generated with Claude Code